
#include <stdio.h>

#define NUM 1024
#define BUFF_NONE 0x1
#define BUFF_LINE 0x2
#define BUFF_ALL  0x4

typedef struct _MY_FILE
{
    int fd;
    int flags; // flush method
    char buffer[NUM];
    int  cur;
} MY_file;


MY_file *my_fopen(const char *path, const char *mode);
size_t my_fwrite(const void *ptr, size_t size, size_t nmemb,MY_file *stream);
int my_fclose(MY_file  *fp);
int my_fflush(MY_file *fp);
